package com.xiaomi.shwx.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaomi.shwx.entity.dto.MaterialsDTO;
import com.xiaomi.shwx.entity.dto.WorkOrderDTO;
import com.xiaomi.shwx.entity.pojo.WorkOrder;
import com.xiaomi.shwx.entity.request.WorkOrderSearchRequest;
import com.xiaomi.shwx.entity.vo.WorkOrderVO;

import java.util.List;

/**
 * <p>
 * 工单 服务类
 * </p>
 *
 * @author Lei
 * @since 2024-05-15
 */
public interface WorkOrderService extends IService<WorkOrder> {
    /**
     * 获取工单列表
     * @param request
     * @return
     */
    public List<WorkOrderVO> listOrder(WorkOrderSearchRequest request);

    /**
     * 获取用户刚创建的工单
     * @return
     */
    public List<WorkOrderVO> listInitialOrder();

    /**
     * 工程师申请物料
     * @param materialsDTO
     * @return
     */
    void applyMaterials(MaterialsDTO materialsDTO);
    WorkOrderVO addOrder(WorkOrder order);

    String createOrder(WorkOrderDTO dto);

    String cancelOrder(String workorderId);

    List<WorkOrderVO> getOrdersByUserId(String userId);

    WorkOrderVO userGetOrderById(String workorderId);

    /**
     * 更新工单信息
     * @param order
     * @return
     */
    WorkOrderVO updateOrder(WorkOrder order);

    /**
     * 支付订单
     *
     * @param order
     * @return
     */
    WorkOrderVO payOrder(WorkOrder order);

    /**
     * 确认订单
     *
     * @param order
     * @return
     */
    WorkOrderVO confirmOrder(WorkOrder order);

    /**
     * 复检完成
     *
     * @param order
     * @return
     */
    WorkOrderVO recheckDone(WorkOrder order);
}
